<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
		<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
		<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
		<title>修改密码</title>
		<link rel="stylesheet" href="css/style.css" />
		<script>
			//若用户未登录，则需先登录
			var logstatu = sessionStorage['LoginName'];
			console.log("name is " + name);
			console.log("statu is " + logstatu);
			if (!logstatu) {
				location.href = 'c_login.html';
				console.log(logstatu);
			}
		</script>

		<script src="js/login/register.js"></script>
		<script>
			var user = getUser();
		</script>
		<script>$.mobile.ajaxEnabled = false;</script>
	</head>
	<body>
		<div data-role="page">
			<div data-role="header" id="opcitybg">
				<h1>修改密码</h1>
			</div>

			<div data-role="main" class="ui-content">
				<form method="post" action="">
					<div class="ui-field-contain">
						<label for="password">密码:</label>
						<input type="password" name="password" id="password">
						<label for="repassword">确认密码:</label>
						<input type="password" name="repassword" id="repassword">
					</div>
					<div id="cbt">
						<input type="button" id="uppsd" data-inline="true" value="确认">
						<input type="reset" data-inline="true" value="重置">
					</div>


					<div data-role="footer" data-position="fixed" id="footerbg">
						<p style="text-align:center;color:#FFAA00">copyright@chen</p>
					</div>
				</form>
			</div>
		</div>
	</body>
	<script src="js/login/checkMessage.js"></script>
	<script>
		var pass = $("#password");
		var repass = $("#repassword");
		pass.change(function() {
			checkPassword(pass.val());
		});
		repass.change(function() {
			checkPassword(repass.val());
		});
		
		//点击事件
		$("#uppsd").click(function() {
			if(checkPassword(pass.val())||checkPassword(repass.val())){
				updatePassword(pass.val());
				alert("密码修改成功");
				location.href="c_personal.html";
			}
		});
	</script>
</html>
